package net.nampham.visioncontrol.view;

import net.nampham.visioncontrol.model.Vec2;

public class Vec3 {
	public float v[];
	public Vec3(float x, float y, float z){
		v = new float[4];
		v[0] = x;
		v[1] = y;
		v[2] = z;
		v[3] = 1.0f;
	}
	
	public Vec3(Vec2 src){
		this(src.x, src.y, 0.0f);
	}
	
	public Vec3 add(Vec3 other){
		return new Vec3(
					v[0] + other.v[0],
					v[1] + other.v[1],
					v[2] + other.v[2]
				);		
	}
	
	public Vec3 mul(float scalar){
		return new Vec3(v[0] * scalar,
				v[1] * scalar,
				v[2] * scalar);
	}
}
